package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;
    //天数
    private int dayType = -1;
    //人均消费
    private int perExpendType = -1;
    //出发时间
    private int travelTimeType = -1;
    //排序
    private int orderType = 1;

    public String getOrderBy(){
        return orderType == 2 ? "t.viewnum desc" : "t.createTime desc";
    }

    public TravelCondition getDays(){
        return TravelCondition.dayMap.get(dayType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.perExpendMap.get(perExpendType);
    }

    public TravelCondition getTravelTime(){
        return TravelCondition.travelTimeMap.get(travelTimeType);
    }
}
